export default (initialState: IGlobal.IInitialState) => {
    // 在这里按照初始化数据定义项目中的权限，统一管理
    // 参考文档 https://umijs.org/docs/max/access
    const { isAuthName, user, auth } = initialState || {};
    // console.log(isAuthName,user,auth);
    const checkAuthName = isAuthName?.status === 2; //是否实名认证
    const isVip = auth?.level || false;
    //是否有权限查看竞拍
    const isJingPaiPage = auth?.auth === 'all' || (auth?.level && auth?.level > 0 && auth?.auth?.indexOf("look_tenders") > -1);
    //是否有权限查看资料库 还有vip才能查看
    const isZiYuanKuPage = auth?.level && auth?.level > 0;
    return {
        isVip,
        isAtuhName: checkAuthName,
        isJingPaiPage: !!isJingPaiPage,
        isZiYuanKuPage: !!isZiYuanKuPage
    };
};
